import request from '@/api/request';
import { apiJava, apiHr, apiYp, apiClusterJava } from '@/api/root';

/* ------------------------------------------应聘者线上资料化------------------------------------------ */
// 获取资料列表入口权限
export const entryPermission = (data) => {
  return request.webservice(
    'yloa',
    `${apiHr}/api/api.php`,
    '/v2/candidate/entryPermission',
    data
  );
};

// 应聘者列表
export const candidateList = (data) => {
  return request.webservice(
    'yloa',
    `${apiHr}/api/api.php`,
    '/v2/candidate/candidateList',
    data
  );
};

// 获取简历详情
export const resume = (data) => {
  return request.webservice(
    'yloa',
    `${apiHr}/api/api.php`,
    '/v2/candidate/resume',
    data
  );
};

// 获取教育详情
export const eduAndTrain = (data) => {
  return request.webservice(
    'yloa',
    `${apiHr}/api/api.php`,
    '/v2/candidate/eduAndTrain',
    data
  );
};

// 获取工作经历详情
export const work = (data) => {
  return request.webservice(
    'yloa',
    `${apiHr}/api/api.php`,
    '/v2/candidate/work',
    data
  );
};

// 获取家庭成员详情
export const family = (data) => {
  return request.webservice(
    'yloa',
    `${apiHr}/api/api.php`,
    '/v2/candidate/family',
    data
  );
};

// 获取试题答题详情
export const exam = (data) => {
  return request.webservice(
    'yloa',
    `${apiHr}/api/api.php`,
    '/v2/candidate/exam',
    data
  );
};

// 查询详情权限
export const detailPermission = (data) => {
  return request.webservice(
    'yloa',
    `${apiHr}/api/api.php`,
    '/v2/candidate/detailPermission',
    data
  );
};

/* ------------------------------------------数据字典------------------------------------------ */
// 获取行业子类
export const getTradeInfo = (data) => {
  return request.webserviceOld('company', 'trade/getTradeInfoByTotalid', data);
};

// 获取职位分类
export const getTradeZwCache = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_intended_industry_busi/getTradeZwCache',
    data,
    {
      version: 'v7.7.0'
    }
  );
};

// 获取行业列表
export const getTradeList = (data) => {
  return request.webserviceOld(
    'company',
    'cma_employer_deal/get_trade_list',
    data
  );
};

// 获取地区列表
export const getRegion = (data) => {
  return request.webserviceOld('job1001', 'region/getRegion', data);
};
/* ------------------------------------------公共接口------------------------------------------ */
// 获取网站tradeid
export const getTradeInfoByUrl = (data) => {
  return request.webserviceOld('jobweb', 'trade/getTradeInfoByUrl', data, {
    isOriginal: true
  });
};

// 获取用户信息
export const getPersonDetail = (data) => {
  return request.webserviceOld('job1001', 'person/getPersonDetail', data);
};

// 获取登录信息
export const getLoginInfo = (data) => {
  return request.webserviceOld('job1001', 'yLIM_api/getInitPInfo', data);
};
// // 获取用户信息
// export const getUserInfo = (data) => {
//   return request.webserviceOld('job1001',  'yLIM_api/getUserInfo', data);
// };
// 注册用户
export const registerUser = (data) => {
  return request.webserviceOld('job1001', 'yLIM_api/registerUser', data);
};

// 各种消息提醒数
export const getMessageSidebarCnt = (data) => {
  return request.webserviceOld(
    'job1001',
    'yl_app_push_busi/getMessageSidebarCnt',
    data,
    {
      version: 'v7.5.1'
    }
  );
};

// 上传接口
export const uploadAction = 'https://img106.job1001.com/save.php';

// 上传根目录
export const uploadBaseUrl = 'https://img106.job1001.com/';

// 获取行业总网信息
export const getAllTotalInfo = (data) => {
  return request.post(`${apiClusterJava}/api-yp/trade/getAllTotalInfo`, data);
};

// 获取文件
export const getFileByUrl = (url) => {
  return request.get(url);
};

/* -------简历诊断--------- */
// 获取简历诊断评定结果
export const getResumeDiagnoseResult = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/resumeDiagnoseOpen/getResumeDiagnoseResult',
    data
  );
};

// 分页获取简历诊断记录
export const getPageResumeDiagnoseRecord = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/resumeDiagnoseOpen/getPageResumeDiagnoseRecord',
    data
  );
};

// 更新简历诊断阅读状态
export const updateResumeDiagnoseReadStat = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/resumeDiagnoseOpen/updateResumeDiagnoseReadStat',
    data
  );
};

// 获取简历诊断简历记录
export const getResumeDiagnoseRecord = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/resumeDiagnoseOpen/getResumeDiagnoseRecord',
    data
  );
};

// 获取剩余解锁次数
export const getLeftUnlockNum = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/resumeDiagnoseOpen/getLeftUnlockNum',
    data
  );
};

// 解锁简历诊断结果
export const unlockResumeDiagnose = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/resumeDiagnoseOpen/unlockResumeDiagnose',
    data
  );
};

// 简历诊断结果下单支付
export const addOrderAndPay = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/activityOrderOpen/addOrderAndPay',
    data
  );
};

// 提交诊断简历
export const uploadResumeFuJianToDiagnose = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/resumeDiagnoseOpen/uploadResumeAndDiagnose',
    data
  );
};
// 提交诊断简历的状态
export const getResumeFuJianDiagnoseStatus = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/resumeDiagnoseOpen/getLatelyResumeDiagnoseRecord',
    data
  );
};

// // 获取诊断简历
// export const getResumeFuJianOnDiagnose = (data) => {
//   return request.webservice('mp', `${apiClusterJava}/api-yp/open/index`, '/resumeOpen/getPersonResume', data);
// };
// 获取诊断简历 array类型
export const getResumeFuJianOnDiagnose = (data) => {
  return request.webservice(
    'cr',
    `${apiClusterJava}/api-career/open/index`,
    '/personResumeAttachment/getPersonResumeAttachmentList',
    data
  );
};
// 添加简历
export const addPersonAddAttachment = (data) => {
  return request.webservice(
    'cr',
    `${apiClusterJava}/api-career/open/index`,
    '/personResumeAttachment/personAddAttachment',
    data
  );
};

/* ------------------------------------------登录注册------------------------------------------ */
// 微信登录
export const wxLogin = (data) => {
  return request.post(`${apiClusterJava}/api-yp/wechat/wxLogin`, data);
};

// 绑定openid
export const bindPerson = (data) => {
  return request.post(`${apiClusterJava}/api-yp/wechat/bindInfo`, data);
};

// 获取sessionKey
export const getWxLoginInfo = (data) => {
  return request.post(`${apiClusterJava}/api-yp/wechat/loginInfo`, data);
};

// 获取UID
export const getUnionID = (data) => {
  return request.post(`${apiClusterJava}/api-yp/wechat/getUnionID`, data);
};

// 绑定手机
export const bindPhone = (data) => {
  return request.post(`${apiClusterJava}/api-yp/wechat/registerAndBind`, data);
};

// 检测手机是否注册
export const checkUnameCanReg = (data) => {
  return request.post(`${apiClusterJava}/api-yp/register/checkUname`, data);
};

// 手机登录验证码
export const sendLoginCode = (data) => {
  return request.post(`${apiClusterJava}/api-yp/login/sendSmsCode`, data);
};

// 手机注册验证码
export const sendRegcode = (data) => {
  return request.post(`${apiClusterJava}/api-yp/register/sendSmsCode`, data);
};

// 验证码登录
export const loginByCode = (data) => {
  return request.post(`${apiClusterJava}/api-yp/login/codeSubmit`, data);
};

// 密码登录
export const loginByAccount = (data) => {
  return request.post(`${apiClusterJava}/api-yp/login/pwdSubmit`, data);
};

// 注册
export const registerBySmsForXCX = (data) => {
  return request.post(`${apiClusterJava}/api-yp/register/submit`, data);
};

// PC扫码用户信息
export const qrScanInfo = (data) => {
  return request.post(`${apiClusterJava}/api-yp/wechat/qrScanInfo`, data);
};

// PC扫码确认登录
export const qrLoginConfirm = (data) => {
  return request.post(`${apiClusterJava}/api-yp/wechat/qrLoginConfirm`, data);
};

// 小程序扫码确认登录
export const getLoginQr = (data) => {
  return request.post(
    `${apiClusterJava}/api-yp/wechat/personLoginQrCode`,
    data
  );
};

export const checkLoginQr = (data) => {
  return request.post(`${apiClusterJava}/api-yp/wechat/checkQrLogin`, data);
};

// 获取验证码id
export const captchaInit = (data) => {
  return request.get(`${apiClusterJava}/api-auth/common/captcha/init`, data);
};

/* ------------------------------------------简历------------------------------------------ */
// 获取用户简历
export const getResumeData = (data) => {
  return request.webserviceOld(
    'company',
    'cma_weixin_deal/getResumePreviewData',
    data
  );
};

// 获取简历完整度
export const getResumeIntegrity = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_info_busi/getPersonResumeIntegrity',
    data,
    {
      version: 'v7.5.1'
    }
  );
};

// 刷新简历
export const refreshResume = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_sub_busi/refreshResume',
    data,
    {
      version: 'v5.9.18'
    }
  );
};

// 上传头像
export const uploadAvatar = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_busi/uploadimgForImgurl',
    data,
    {
      version: 'v7.5.1'
    }
  );
};

// 简历-保存工作经验
export const saveExperience = (data) => {
  return request.webserviceOld(
    'company',
    'cma_weixin_deal/updataObjColumn',
    data
  );
};

// 简历-删除工作经历
export const deleteExperience = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_sub_busi/deletePersonWorkDetail',
    data,
    {
      version: 'v5.9.17'
    }
  );
};

// 添加项目经验
export const addProject = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_sub_busi/addPersonProject',
    data,
    {
      version: 'v5.9.18'
    }
  );
};

// 更新项目经验
export const updateProject = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_sub_busi/updatePersonProject',
    data,
    {
      version: 'v5.9.18'
    }
  );
};

// 删除项目经验
export const deleteProject = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_sub_busi/deletePersonProjectDetail',
    data,
    {
      version: 'v5.9.17'
    }
  );
};

// 添加/修改教育背景
export const updateEducation = (data) => {
  return request.webserviceOld(
    'company',
    'cma_weixin_deal/updataObjColumn',
    data
  );
};

// 删除教育背景
export const deleteEducation = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_sub_busi/deletePersonEduDetail',
    data,
    {
      version: 'v5.9.17'
    }
  );
};

// 检验手机或邮箱是否已绑定
export const checkCanBind = (data) => {
  return request.webserviceOld(
    'job1001',
    'job1001user_person_bind_busi/checkCanBind',
    data,
    {
      version: 'v5.9.22'
    }
  );
};

// 手机或邮箱绑定验证码
export const sendBindCode = (data) => {
  return request.webserviceOld(
    'job1001',
    'job1001user_person_bind_busi/sendBindCode',
    data,
    {
      version: 'v5.9.22'
    }
  );
};

// 验证手机或邮箱绑定验证码
export const checkBindCode = (data) => {
  return request.webserviceOld(
    'job1001',
    'job1001user_person_bind_busi/checkCode',
    data,
    {
      version: 'v5.9.22'
    }
  );
};

// 保存基本信息
export const updatePersonDetail = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_info_busi/updatePersonDetail',
    data,
    {
      version: 'v7.2.5'
    }
  );
};

// 添加培训经历
export const addTrain = (data) => {
  return request.webserviceOld('job1001', 'person_sub_busi/addTrain', data, {
    version: 'v5.9.18'
  });
};

// 更新培训经历
export const updateTrain = (data) => {
  return request.webserviceOld('job1001', 'person_sub_busi/updateTrain', data, {
    version: 'v5.9.18'
  });
};

// 删除培训经历
export const deleteTrain = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_info_busi/detelePersonTrain',
    data,
    {
      version: 'v5.9.17'
    }
  );
};
// 添加校园经历
export const addPersonStudentLeader = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_sub_busi/addPersonStudentLeader',
    data,
    {
      version: 'v5.9.18'
    }
  );
};

// 更新校园经历
export const updatePersonStudentLeader = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_sub_busi/updatePersonStudentLeader',
    data,
    {
      version: 'v5.9.18'
    }
  );
};

// 删除校园经历
export const deletePersonStudentLeaderDetail = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_sub_busi/deletePersonStudentLeaderDetail',
    data,
    {
      version: 'v5.9.17'
    }
  );
};
// 添加荣誉奖项
export const addPersonAward = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_sub_busi/addPersonAward',
    data,
    {
      version: 'v5.9.18'
    }
  );
};

// 更新荣誉奖项
export const updatePersonAward = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_sub_busi/updatePersonAward',
    data,
    {
      version: 'v5.9.18'
    }
  );
};

// 删除荣誉奖项
export const deletePersonAward = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_sub_busi/deletePersonAward',
    data,
    {
      version: 'v5.9.18'
    }
  );
};

// 添加证书
export const addCer = (data) => {
  return request.webserviceOld('job1001', 'person_sub_busi/addCer', data, {
    version: 'v5.9.18'
  });
};

// 更新证书
export const updateCer = (data) => {
  return request.webserviceOld('job1001', 'person_sub_busi/updateMycer', data, {
    version: 'v5.9.18'
  });
};

// 删除证书
export const deleteCer = (data) => {
  return request.webserviceOld('job1001', 'person_sub_busi/deleteCer', data, {
    version: 'v5.9.17'
  });
};

// 工作经历行业列表
export const getTradeListForWordExperience = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_sub_busi/getTradeListForWordExperience',
    data,
    {
      version: 'v7.7.0'
    }
  );
};

// 获取简历完善度
export const getResumeInfo = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_info_busi/getResumeInfo',
    data,
    {
      version: 'v9.1.0'
    }
  );
};

/* ------------------------------------------首页------------------------------------------ */
// 获取regionid
export const getRegionByXY = (data) => {
  return request.webserviceOld('job1001', 'region/getregionQQbyXY', data);
};

// 招聘会列表
export const getZphList = (data) => {
  return request.webserviceOld(
    'job1001',
    'zph_activity_busi/getZphList',
    data,
    {
      version: 'v7.5.1'
    }
  );
};

// 热门职位列表
export const getHotJob = (data) => {
  return request.webserviceOld('company', 'zp_info/getHotZp_3G', data);
};

// 适合职位列表
export const getSuitableJob = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_sub_busi/get_suitable_jobs',
    data,
    {
      version: 'v5.9.22'
    }
  );
};

// 搜索结果
export const searchZp = (data) => {
  return request.webserviceOld('job1001', 'zp_info_busi/searchZp', data, {
    version: 'v7.8.7'
  });
};

// 获取求职意向信息
export const getMyIntendedTradeList = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_intended_industry_busi/getMyIntendedTradeList',
    data,
    {
      version: 'v7.2.8'
    }
  );
};

// 更新求职意向状态
export const updateStatusAndWorkData = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_intended_industry_busi/updateStatusAndWorkData',
    data,
    {
      version: 'v7.3.5'
    }
  );
};

// 获取单个求职意向信息
export const getIntendedTradeInfo = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_intended_industry_busi/getIntendedTradeInfo',
    data,
    {
      version: 'v7.2.8'
    }
  );
};

// 直播banner
export const getBannerLive = (data) => {
  return request.get(`${apiJava}/m/live/getBannerLive`, data || {});
};

// 直播行业分类
export const getLiveTrade = (data) => {
  return request.get(`${apiJava}/m/live/getLiveTrade`, data || {});
};

// 直播列表
export const getLiveListByTrade = (data) => {
  return request.post(`${apiJava}/m/live/getLiveListByTrade`, data || {});
};

// 获取直播信息
export const getLiveInfo = (data) => {
  return request.post(`${apiJava}/live/info`, data || {});
};

/* ------------------------------------------个人中心------------------------------------------ */
// 获取关注企业列表
export const getConcernCompany = (data) => {
  return request.webserviceOld(
    'job1001',
    'zd_person_follow_rel/new_get_follow_list',
    data
  );
};

// 是否企业用户-旧体系
export const isCompanyPersonOld = (data) => {
  return request.webserviceOld(
    'job1001',
    'binding_salerperson_busi/getCompanyHrIdentityInfo',
    data,
    {
      version: 'v7.5.1'
    }
  );
};

// 是否企业用户-新体系
export const isCompanyPerson = (data) => {
  return request.webserviceOld(
    'company',
    'bingding_companyperson_slave/isCompanyPerson',
    data
  );
};

// 是否企业用户-旧体系
export const isCompanyPersonNoSlave = (data) => {
  return request.webserviceOld(
    'company',
    'bingding_companyperson/isCompanyPerson',
    data
  );
};

// 简历外发
export const resumeSendOut = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_sub_busi/resumeSendOut',
    data,
    {
      version: 'v5.9.18'
    }
  );
};

// 获取附件简历列表
export const getPersonFuJianList = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_fujian_busi/getPersonFuJianList',
    data,
    {
      version: 'v7.3'
    }
  );
};

// 上传附件简历
export const uploadResumeFuJian = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_fujian_busi/uploadResumeFuJian',
    data,
    {
      version: 'v7.3'
    }
  );
};

// 删除附件简历
export const deleteResumeFuJian = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_fujian_busi/deleteResumeFuJian',
    data,
    {
      version: 'v7.3'
    }
  );
};
// 添加求职意向
export const addIntendedTrade = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_intended_industry_busi/addIntendedTrade',
    data,
    {
      version: 'v7.2.8'
    }
  );
};

// 更新求职意向
export const updateIntendedTrade = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_intended_industry_busi/updateIntendedTrade',
    data,
    {
      version: 'v7.2.8'
    }
  );
};

// 删除求职意向
export const deleteIntendedTrade = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_intended_industry_busi/deleteIntendedTrade',
    data,
    {
      version: 'v7.2.8'
    }
  );
};

// 修改密码
export const changePassword = (data) => {
  return request.webserviceOld('job1001', 'persondeal/updatePassword', data);
};

// 弱密码强化，修改密码
export const strengthenPassword = (data) => {
  return request.webserviceOld('job1001', 'persondeal/resetPwd', data);
};
/* ------------------------------------------面试------------------------------------------ */
// 人才面试通知列表
export const getPInterviewList = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_info_busi/getPInterviewList',
    data,
    {
      version: 'v7.2.8'
    }
  );
};

// 面试邀请数
export const getPersonDeliveryCnt = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_center_busi/statePersonDeliveryCnt',
    data,
    {
      version: 'v7.2.8'
    }
  );
};

// 面试详情
export const getInterviewDetail = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_info_busi/getInterviewDetail',
    data,
    {
      version: 'v7.2.8'
    }
  );
};

// 拒绝面试邀请
export const rejectInterview = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_info_busi/rejectInterview',
    data,
    {
      version: 'v7.2.8'
    }
  );
};

// 接受面试邀请
export const acceptInterview = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_info_busi/acceptInterview',
    data,
    {
      version: 'v7.2.8'
    }
  );
};

/* ------------------------------------------消息------------------------------------------ */
// 获取聊天对象信息
export const getUserRawInfo = (data) => {
  return request.webserviceOld('job1001', 'yLIM_api/getUserRawInfo', data);
};

// 获取聊天列表
export const getMsgList = (data) => {
  return request.webserviceOld(
    'job1001',
    'zd_person_msg_busi/get_person_msg_list',
    data,
    {
      version: 'v6.0'
    }
  );
};

// 职位收藏
export const getPFavoriteList = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_info_api/get_by_pfavorite',
    data
  );
};

// 获取招聘聊天信息
export const getZPChatInfo = (data) => {
  return request.webserviceOld('job1001', 'yLIM_api_busi/getZPChatInfo', data, {
    version: 'v6.0'
  });
};

// 聊天中投递简历
export const sendJob = (data) => {
  return request.webserviceOld('job1001', 'person_info_api/send_job', data);
};

// 添加聊天职位关联
export const addChatZwRel = (data) => {
  return request.webserviceOld('job1001', 'yLIM_api_busi/addChatZwRel', data, {
    version: 'v6.0'
  });
};

// 人才发送请求电话信息
export const applyPhoneEx = (data) => {
  return request.webserviceOld('job1001', 'yLIM_api_busi/applyPhoneEx', data, {
    version: 'v7.5.1'
  });
};

// 企业发送请求电话信息
export const getCompanyPhoneList = (data) => {
  return request.webserviceOld(
    'job1001',
    'yLIM_api_busi/getCompanyPhoneList',
    data,
    {
      version: 'v7.5.1'
    }
  );
};

// 同意交换电话
export const doAgreePhoneEx = (data) => {
  return request.webserviceOld(
    'job1001',
    'yLIM_api_busi/doAgreePhoneEx',
    data,
    {
      version: 'v7.5.1'
    }
  );
};

// 拒绝交换电话
export const disAgreePhoneEx = (data) => {
  return request.webserviceOld(
    'job1001',
    'yLIM_api_busi/disAgreePhoneEx',
    data,
    {
      version: 'v7.5.1'
    }
  );
};

// 交换电话状态
export const getExPhoneMess = (data) => {
  return request.webserviceOld(
    'job1001',
    'yLIM_api_busi/getExPhoneMess',
    data,
    {
      version: 'v7.5.1'
    }
  );
};

// 检查和更新极光账号
export const checkAndUpdateUser = (data) => {
  return request.webserviceOld(
    'job1001',
    'yLIM_api_busi/checkAndUpdateUser',
    data
  );
};

// IM初始化用户信息
export const initUserInfo = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/tencentIm/initUserInfo',
    data
  );
};

// IM获取用户信息
export const getUserInfo = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/tencentIm/getUserInfo',
    data
  );
};

/* ------------------------------------------已收简历------------------------------------------ */
// 已收简历列表
export const getSendJobResume = (data) => {
  return request.webservice(
    'ylt',
    `${apiYp}/v5/api/api.php`,
    '/v1/company_resume/getSendJobResume',
    data
  );
};

/* ------------------------------------------职位详情------------------------------------------ */

// 职位详情
export const getJobDetail = (data) => {
  return request.webserviceOld('company', 'company_cache/getZpDetail', data);
};

// 是否能沟通
export const getJobCanTalk = (data) => {
  return request.webserviceOld('job1001', 'yLIM_api/getJobCanTalk', data);
};

// 职位详情 & 3天内是否已投递
export const getZpDetailAndApplyStatus = (data) => {
  return request.webserviceOld(
    'company',
    'company_cache/getZpDetailAndApplyStatus',
    data
  );
};

// 获取职位发布人信息
export const batchGetBingdingPersonInfo = (data) => {
  return request.webserviceOld(
    'company',
    'person_job_slave/batchGetBingdingPersonInfo',
    data
  );
};
// 职位收藏状态
export const isfavoriteZp = (data) => {
  return request.webserviceOld('job1001', 'pfavorite/isfavoriteZp', data);
};

// 职位收藏
export const pfavorite = (data) => {
  return request.webserviceOld('job1001', 'person_info_api/pfavorite', data);
};

// 职位取消收藏
export const deletePfavorite = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_info_api/delete_pfavorite',
    data
  );
};

// 招聘要求
export const getZpTxtDetail = (data) => {
  return request.webserviceOld('company', 'company_cache/getZpTxtDetail', data);
};

// 公司详情
export const getCompanyDetail = (data) => {
  return request.webserviceOld(
    'company',
    'company_cache/getCompanyDetail',
    data
  );
};

// 公司福利
export const getComapnyTags = (data) => {
  return request.webserviceOld(
    'company',
    'company_cache/get_comapny_tags',
    data
  );
};

// 公司职位
export const getCompanyZpList = (data) => {
  return request.webserviceOld(
    'job1001',
    'company_info/getCompanyZpList_3G',
    data
  );
};

// 是否关注企业
export const isCompanyFollow = (data) => {
  return request.webserviceOld('job1001', 'Company_visit/isFollow', data, {
    isOriginal: true
  });
};

// 是否是顾问 (弃用)
export const getBrokerIdentityInfo = (data) => {
  return request.webserviceOld(
    'job1001',
    'binding_salerperson_busi/getBrokerIdentityInfo',
    data,
    {
      version: 'v7.8.6',
      isOriginal: true
    }
  );
};

// 关注企业
export const addCompanyFollow = (data) => {
  return request.webserviceOld('job1001', 'Company_visit/addFollow', data, {
    isOriginal: true
  });
};

// 取消关注企业
export const cancelCompanyFollow = (data) => {
  return request.webserviceOld('job1001', 'Company_visit/cancelFollow', data, {
    isOriginal: true
  });
};

// 申请职位(投递职位)
export const applyzw = (data) => {
  return request.webserviceOld('company', 'person/doApplyForWx', data);
};

// 投递简历校验
export const checkResumeCompleteNew = (data) => {
  return request.webserviceOld(
    'job1001',
    'person/checkResumeCompleteNew',
    data
  );
};

// 简历完善度校验
export const checkPersonCompleteNew = (data) => {
  return request.webserviceOld(
    'job1001',
    'person/checkPersonCompleteNew',
    data
  );
};

// 投递简历
export const resumeDeliveryNew = (data) => {
  return request.webserviceOld('job1001', 'person_info_api/send_person', data);
};

// 投递记录(申请记录)
export const getMyCmailboxList = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_info_busi/getMyCmailboxList',
    data,
    {
      version: 'v5.9.18'
    }
  );
};

// 职位投递
export const personSendJob = (data) => {
  return request.post(
    `${apiClusterJava}/api-yp/yp/rights/person/sendJob`,
    data
  );
};

// 根据ip获取regionid
export const getIpLocation = (data) => {
  return request.get(`${apiClusterJava}/api-yp/common/ipLocation`, data);
};

// 新增分享链接记录
export const addShareLog = (data) => {
  return request.post(`${apiClusterJava}/api-yp/share/addShareLog`, data);
};

// 点击分享链接事件
export const clickShareLink = (data) => {
  return request.post(`${apiClusterJava}/api-yp/share/clickShareLink`, data);
};

// 首页“简历优化”提示卡显示状态
export const getResumeAmendShowStatus = (data) => {
  return request.webserviceOld(
    'job1001',
    'yl_app_push_busi/getResumeCompleteStatus',
    data,
    {
      version: 'v9.1.0'
    }
  );
};

// 首页“简历优化”提示卡被关闭上报
export const uploadResumeAmendShowStatus = (data) => {
  return request.webserviceOld(
    'job1001',
    'yl_app_push_busi/setVisitLog',
    data,
    {
      version: 'v9.1.0'
    }
  );
};


// 首页“简历隐藏”提示状态
export const getResumeBarShowStatus = (data) => {
  return request.webserviceOld(
    'job1001',
    'yl_app_push_busi/getResumeResumeKjStatus',
    data,
    {
      version: 'v9.1.0'
    }
  );
};


// “简历隐藏”修改为公开
export const fixResumeOnPublicStatus = (data) => {
  return request.webserviceOld(
    'job1001',
    'person_info_api/secrecy_setting',
    data,
  );
};

// 搜索时显示提示词（职位）
export const searchCareerWithKeyword = (data) => {
  return request.webserviceOld(
    'job1001',
    'zp_info_busi/searchKeywordByZp',
    data,
    {
      version: 'v9.1.0'
    }
  );
};


// 顾问预约列表
export const getConsultantList = (data) => {
  return request.webservice(
    'cr',
    `${apiClusterJava}/api-career/open/index`,
    '/consultantAppointment/getConsultantList',
    data
  );
};

// 获取顾问可预约时间列表
export const getConsultantTimeList = (data) => {
  return request.webservice(
    'cr',
    `${apiClusterJava}/api-career/open/index`,
    '/consultantAppointment/getConsultantTimeList',
    data
  );
};

// 添加预约
export const addAppointment = (data) => {
  return request.webservice(
    'cr',
    `${apiClusterJava}/api-career/open/index`,
    '/consultantAppointment/addAppointment',
    data
  );
};

// 获取用户预约信息列表
export const getPersonAppointmentList = (data) => {
  return request.webservice(
    'cr',
    `${apiClusterJava}/api-career/open/index`,
    '/consultantAppointment/getPersonAppointmentList',
    data
  );
};
// 回显用户预约信息列表
export const getPersonAppointmentInfo = (data) => {
  return request.webservice(
    'cr',
    `${apiClusterJava}/api-career/open/index`,
    '/consultantAppointment/getPersonAppointmentInfo',
    data
  );
};

// 取消预约
export const cancelAppointment = (data) => {
  return request.webservice(
    'cr',
    `${apiClusterJava}/api-career/open/index`,
    '/consultantAppointment/cancelAppointment',
    data
  );
};

// 获取顾问预约状态
export const getConsultantAppointmentStatus = (data) => {
  return request.webservice(
    'cr',
    `${apiClusterJava}/api-career/open/index`,
    '/consultantAppointment/getConsultantAppointmentStatus',
    data
  );
};

// 获取顾问预约状态
export const getPersonLastAppointment = (data) => {
  return request.webservice(
    'cr',
    `${apiClusterJava}/api-career/open/index`,
    '/consultantAppointment/getPersonLastAppointment',
    data
  );
};

// 生成小程序链接
export const getMpUrlLink = (data) => {
  return request.post(`${apiClusterJava}/api-yp/wechat/getMpUrlLink`, data);
};

// 行业列表
export const getZpTrade = (data) => {
  return request.webservice(
    'mp',
    `${apiClusterJava}/api-yp/open/index`,
    '/jobOpen/trade',
    data
  );
};
